home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_objc.idb / usr / freeware / include / objcrt / Block.h.z / Block.h
Encoding:
C/C++ Source or Header  |  1999-07-16  |  1.7 KB  |  69 lines

  1.  
  2. /*
  3.  * Portable Object Compiler (c) 1997,98.  All Rights Reserved.
  4.  * $Id: Block.h,v 1.12 1999/06/23 19:22:09 stes Exp $
  5.  */
  6.  
  7. /*
  8.  * This library is free software; you can redistribute it and/or modify it
  9.  * under the terms of the GNU Library General Public License as published 
  10.  * by the Free Software Foundation; either version 2 of the License, or
  11.  * (at your option) any later version.
  12.  *
  13.  * This program is distributed in the hope that it will be useful,
  14.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16.  * GNU Library General Public License for more details.
  17.  *
  18.  * You should have received a copy of the GNU Library General Public License
  19.  * along with this program; if not, write to the Free Software
  20.  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  21.  */
  22.  
  23. #ifndef __BLOCK_H__
  24. #define __BLOCK_H__
  25.  
  26. #ifdef __PORTABLE_OBJC__
  27.  
  28. #ifndef __OBJECT_INCLUDED__
  29. #define __OBJECT_INCLUDED__
  30. #include "Object.h" /* Stepstone Object.h assumes #import */
  31. #endif
  32.  
  33. #ifndef EXPORT
  34. #define EXPORT /* empty */
  35. #endif
  36.  
  37. /* allows"manual" construction of Blocks, ie. without compiler support */
  38. extern id EXPORT newBlock(int n,IMP fn,void*data,IMP dtor);
  39.  
  40. @interface Block : Object
  41. {
  42.     IMP fn; /* it's not _really_ an IMP, it's just a func pointer */
  43.     IMP dtor; /* idem */
  44.     int nVars;
  45.     void** data;
  46. }
  47.  
  48. + errorHandler;
  49. + errorHandler:aHandler;
  50. - ifError:aHandler;
  51. - value:anObject ifError:aHandler;
  52.  
  53. - value;
  54. - (int) intvalue;
  55. - atExit;
  56. - value:anObject;
  57. - (int) intvalue:anObject;
  58. - value:firstObject value:secondObject;
  59. - (int) intvalue:firstObject value:secondObject;
  60.  
  61. - repeatTimes:(int)n;
  62. @end
  63.  
  64. #endif /* __PORTABLE_OBJC__ */
  65.  
  66. #endif /* __BLOCK_H__ */
  67.  
  68.  
  69.